1. Field of the Invention
The present invention relates to detection of tilt angles of an input image.
2. Description of the Related Art
Sometimes, when an image is read by a scanner, the image to be read is tilted slightly. In a conventional approach, in order to correct for tilt, for example, edges of a document or paper are detected. If the document or paper has a rectangular shape, the edges must be oriented parallel to a main scanning direction or an auxiliary scanning direction, and any deviation from these directions indicates a tilt of the document or paper. However, in this approach, tilt can be detected only when scanning, and tilt of stored images or images transferred from the outside cannot be detected. Further, since tilt of the document or paper is detected, when the paper is not a standard type of paper such as an excerpt, tilt cannot be detected. Further, in the case of scanning two facing pages of a hardcover book, even if the cover is not tilted, the two facing pages may be tilted. Also in this case, detection of tilt is difficult. In order to solve these problems, it is required to detect tilt of the image itself instead of detecting tilt of the document or paper.
In this regard, the related art will be described below. JPH10-283476A describes detection of straight lines in an image by Hough transformation. However, JPH10-283476A does not show detection of tilt of the image itself by Hough transformation. Further, according to experiments conducted by the inventor, in a vote table obtained by Hough transformation of an image, when straight lines having the largest number of votes were determined as straight lines in parallel to tilt of the image, tilt of the straight line having the largest number of votes was often different from tilt of the actual image substantially. For example, if there is a photograph, picture or a graphic pattern in the image, and the photograph, picture or graphic pattern includes slanted lines that tend to be extracted by Hough transformation, and angles of slanted lines which are different from tilt of the image itself tend to be detected.